import http from "../api";

export const getHomeCard = () => {
  return http({
    url: "/user/clienthome",
    method: "get",
  });
};

//上传评论
export const postComment = (data: any) => {
  return http({
    url: "/commit/save",
    method: "post",
    data,
  });
};

//获取评论
export const getComment = (data: any) => {
  return http({
    url: "/commit/get",
    method: "get",
    params: data,
  });
};

//更新评论
export const putComment = (data: any) => {
  return http({
    url: "/commit/update",
    method: "post",
    data,
  });
};

//上传配置
export const postConfig = (data: any) => {
  return http({
    url: "/commit/config",
    method: "post",
    data,
  });
};

//获取配置
export const getConfig = (data: any) => {
  return http({
    url: "/commit/config",
    method: "get",
    params: {
      userId: data.userId || "", //用户id
      id: data.id || "", //配置id
    },
  });
};

//获取视频
export const getVideo = () => {
  return http({
    url: "/video/list",
    method: "get",
  });
};

//获取日志
export const getLog = () => {
  return http({
    url: "/commit/log",
    method: "get",
  });
};

//上传aicontent
export const postAiContent = (data: any) => {
  return http({
    url: "/ai/content",
    method: "post",
    data,
  });
};

//获取aicontent
export const getAiContent = (data: any) => {
  return http({
    url: "/ai/content",
    method: "get",
    params: data,
  });
};

//修改aicontent
export const putAiContent = (id: string, data: any) => {
  return http({
    url: `/ai/content/${id}`,
    method: "post",
    data,
  });
};

//上传帮助信息
export const postHelp = (data: any) => {
  return http({
    url: "/commit/help",
    method: "post",
    data,
  });
};

//获取帮助信息
export const getHelp = () => {
  return http({
    url: "/commit/help",
    method: "get",
  });
}